package com.example.user.mapper;


import com.example.user.entity.OrderItem;
import com.example.user.request.CartRequest;
import com.example.user.response.CartResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CartMapper {

    List<CartResponse> cartSelectPage(@Param("userId") Integer userId);

    int cancelCart(@Param("productId") Integer productId);

    List<CartResponse> findById(@Param("id") Integer id);


    int createOrder(@Param("cartRequest") CartRequest cartRequest);

    OrderItem selectOrderItemsById(@Param("cartRequest") CartRequest cartRequest);

    int updateProductQuantity(@Param("cartRequest") CartRequest cartRequest);
}
